/*
 * ran1.h numerical recipes random number gnerator
 */

#include <math.h>

extern float ran1(long *idum);

extern void gaussj(double **a, int n, double **b, int m);

extern float gasdev(long *idum);

extern float poidev(float xm, long *idum);

extern void gcf(float *gammcf, float a, float x, float *gln);

extern float gammln(float xx);

extern float gammp(float a, float x);

extern void mrqcof(double x[], double y[], double sig[], int ndata,
		   double a[], int ia[], int ma, double **alpha,
		   double beta[], double *chisq, void (*funcs)());

extern void mrqmin(double x[], double y[], double sig[], int ndata,
		   double a[], int ia[], int ma, double **covar,
		   double **alpha, double *chisq,
		   void (*funcs)(), double *alamda);

extern float NRerff(float x);

extern void covsrt(double **covar, int ma, int ia[], int mfit);

extern void gser(float *gamser, float a, float x, float *gln);

extern float bessi0(float x);

extern float bessi1(float x);

extern float bessk0(float x);

extern float bessk1(float x);


extern void spline(float x[], float y[], int n, float yp1, 
		   float ypn, float y2[]);

extern void splint(float xa[], float ya[], float y2a[], int n, float x, 
                   float *y);

extern float gammln(float xx);

extern void choldc(float **a, int n, float p[], int *err);

void frprmn(double p[], int n, double ftol, int *iter, double *fret,
	    double (*func)(double []), void (*dfunc)(double [], double []));

void dlinmin(double p[], double xi[], int n, double *fret, double (*func)(double []),
	     void (*dfunc)(double [], double []));

double df1dim(double x);

void mnbrak(double *ax, double *bx, float *cx, float *fa, float *fb, float *fc,
	    double (*func)(double));

void linmin(double p[], double xi[], int n, double *fret, double (*func)(double []));

double f1dim(double x);

float opt_med9(float *p);

float opt_med25(float *p);

float quick_select(float arr[], int n);


